package com.zhn.evsi.component;

import cn.hutool.core.io.file.FileNameUtil;
import com.alibaba.fastjson.JSONObject;
import com.zhn.evsi.client.MarketClient;
import com.zhn.evsi.utils.MultipartFileUtil;
import com.zhn.evsi.utils.OSSUtil;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.concurrent.Future;

@Component
public class ThreadPoolComponent {

    // 多线程异步获取市场组详细信息
    @Resource
    private MarketClient marketClient;

    @Resource
    private OSSUtil ossUtil;

    @Resource
    private MultipartFileUtil multipartFileUtil;

    @Async
    public Future<JSONObject> getMarketGroupsInfo(Integer groupId) {

        return marketClient.groupsInfo(groupId);

    }



}
